草庐IT

c++ - ifstream::is_open vs ifstream::fail?

全部标签

javascript - Chrome 扩展中的 Require.JS : define is not defined

我正在尝试在我的chrome扩展程序中使用Requre.js。这是我的list:{"name":"myextension","version":"1.0","manifest_version":2,"permissions":["http://localhost/*"],"web_accessible_resources":["js/test.js"],"content_scripts":[{"matches":["http://localhost/*"],"js":["js/require.js","js/hd_init.js"]}]}hd_init.jsconsole.log("h

javascript - "window.angular is undefined."使用 Protractor 进行自动化测试时?

我在使用Protractor提供的示例conf.js时似乎出错了。我正在使用grunt-protractor-runner运行测试,但即使使用提供的示例配置也会出错。我的Gruntfile.js看起来像这样:/*globalmodule:false*/module.exports=function(grunt){//Projectconfiguration.grunt.initConfig({protractor:{options:{configFile:"smoketest.conf.js",//DefaultconfigfilekeepAlive:false,//Iffalse,t

javascript - 使用 browserify,未捕获的 ReferenceError : function is not defined

我正在尝试http://browserify.org/中的示例并尝试按如下方式进行函数调用:我的html是:TestBrowserifytest我的javascript是:varunique=require('uniq');vardata=[1,2,2,3,4,5,5,5,6];console.log(unique(data));functionhello(){alert("here");}我做了browserifymain.js-obundle.js,所以我可以成功使用require。但是当我点击按钮时,出现错误:“UncaughtReferenceError:你好未定义”任何建议将

javascript - Chrome 扩展 "$ is not defined"错误

当我处理我的chrome扩展程序时,我收到错误“$isnotdefined”。这是我的list文件:{"name":"X","description":"Snipthispage","version":"2.0","permissions":["activeTab"],"background":{"scripts":["background.js"],"persistent":false},"content_scripts":[{"matches":[""],"js":["jquery-2.0.2.js","jquery.Jcrop.js"],"css":["jquery.Jcrop.

javascript - jQuery when/then/fail with concurrent ajax requests : Which request failed?

想象这样一种场景,我们想要在对“foo”和“bar”的并发请求成功完成后做一些事情,或者如果其中一个或两个失败则报告错误:$.when($.getJSON('foo'),$.getJSON('bar')).then(function(foo,bar){console.log('IfireifBOTHrequestsaresuccessful!');}).fail(function(){console.log('Ifireifoneormorerequestsfailed.');});我如何确定1)对“foo”的请求是否失败,或者2)对“bar”的请求是否失败,或者3)如果两者都失败了?

javascript - jqGrid 错误 - "Element is not a table"

这看起来很简单,但我从jqGrid代码中得到了这个神秘的错误,说“元素不是表格”。这是代码:vargrid_data=[{id:"1",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},{id:"1",invdate:"2010-05-24",name:"test",note:"note",tax:"10.00",total:"2111.00"},{id:"2",invdate:"2010-05-25",name:"test2",note:"note2",ta

javascript - 如何使用 js-ctypes Firefox 扩展调用 native C 代码?

我正在尝试构建一个需要调用nativeC代码的Firefox扩展。我的C程序代码是:#includeintadd(inta,intb){return(a+b);}我的JavaScript代码是:var{Cu}=require('chrome');varself=require('sdk/self');Cu.import("resource://gre/modules/ctypes.jsm");varlib;varputs;lib=ctypes.open('G:\\Shankar\\Project\\Maidsafe\\Firefox\\addon-sdk-1.17\\jsctype_s

javascript - THREE.js:错误消息 "THREE.OBJLoader is not a constructor"

我刚开始学习three.js的使用。看起来很好,但现在我有一个问题,我无法解决。我想加载一个OBJ文件,这是我之前在blender中创建的。为此,我正在尝试使用THREE.OBJloader。我从http://mamboleoo.be/learnThree/复制了代码,但我在第32行收到错误消息“THREE.OBJLoader不是构造函数”。其他一切正常:添加场景、添加Material、添加立方体等。为了简单起见,这是代码:varrenderer,scene,camera,banana;varww=window.innerWidth,wh=window.innerHeight;func

javascript - angularjs + ui 路由器 : redirect to login page when user is not logged in on each state change

我正在使用angularjs和ui-router构建一个简单的博客应用程序,我想监听每个状态变化并检查用户是否已登录。如果他没有登录,我想将他重定向到登录页面。场景非常简单,我试图实现thissolution没有运气。这是相关代码:app.config(function($stateProvider,$urlRouterProvider){$stateProvider.state('app',{url:'',abstract:true});$urlRouterProvider.otherwise('blogs');});app.run(function($rootScope,$stat

javascript - 在 meteor 中使用 spacejam 时出现 "fetch is not found globally and no fetcher passed"

我正在编写单元测试来检查我的api。在我将我的gittest分支与我的dev分支合并之前,一切都很好,但后来我开始遇到这个错误:Apprunningat:http://localhost:4096/spacejam:meteorisreadyspacejam:spawningphantomjsphantomjs:Runningtestsathttp://localhost:4096/localusingtest-in-consolephantomjs:Error:fetchisnotfoundgloballyandnofetcherpassed,tofixpassafetchforyo